package br.embedded.socialapp.business;


/* Copyright (c) 2008 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.TimeZone;

import br.embedded.socialapp.domain.User;
import br.embedded.socialapp.location.Coordenates;
import br.embedded.socialapp.location.LocationHandler;
import br.embedded.socialapp.location.LocationManager;



public class DisplayExtendedProfileDataMySpace {

  public static void main(String[] args) {
	  
//	  User user = profileService.fetchPerson("05942068811499308663");
	  List<User> friends = FriendManager.getInstance().fetchFriends("user50", "ALL", false);
	  System.out.println(friends);
/*	  List<User> friendsDetailed = FriendManager.getInstance().fetchFriends("05504131713099562528", "ORKUT_SANDBOX", true);
	  
	  System.out.println(friends.size());
	  System.out.println(friendsDetailed.size());
	  
	  //user = profileService.fetchPerson("530420627");
	  friends = FriendManager.getInstance().fetchFriends("530420627", "MYSPACE", false);
	  friendsDetailed = FriendManager.getInstance().fetchFriends("530420627", "MYSPACE", true);
	  
	  System.out.println(friends.size());
	  System.out.println(friendsDetailed.size());
	  
/*	  Coordenates c1 = new Coordenates();
	  c1.setLatitude(-7.212466615909);
	  c1.setLongitude(-35.908287420042);
	  c1.setUserLogin("fulanosousa");
	  
	  Coordenates c2 = new Coordenates();
	  c2.setLatitude(-7.2123056);
	  c2.setLongitude(-35.90825);
	  
	  System.out.println(LocationHandler.calculateDistance(c1, c2));
	  
	  SimpleDateFormat myFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
	  myFormat.setTimeZone(TimeZone.getTimeZone ("GMT-3"));
	  Date date1 = null;
	  Date date2 = null;
	  
	  try {
		date1 = myFormat.parse("06/05/2010 17:47:00");
		date2 = myFormat.parse("06/05/2010 17:50:00");
		
		List<Coordenates> list = LocationManager.getInstance().getNearestUsers(c1, date1, date2, 900);
		System.out.println("Funciona: " + list.size());
		
		for (Coordenates coordenates : list) {
			System.out.println(coordenates.getLatitude());
			System.out.println(coordenates.getLongitude());
			System.out.println(coordenates.getDistance());
		}
		
	} catch (ParseException e) {
		e.printStackTrace();
	}
	  
	  
	*/  
	  

  }
}